<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
    <title>已中标药品</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>

    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>已中标药品</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="proProjList.jsp">药品招标管理</a></li>
            <li class="active"><a href="proProjList.jsp">采购项目管理</a></li>
            <li class="active"><a href="#">招标项目查看</a></li>
        </ol>
    </section>
     <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                <div class="form-group form-group-xs">
                     <label>企业编码：</label>
                        <input class="form-control" type="text" id="compCode" placeholder="企业编码" />
                    </div>
                    <div class="form-group form-group-xs">
                     <label>药品编码：</label>
                        <input class="form-control" type="text" id="drugCode" placeholder="药品编码" />
                    </div>
                     <div class="form-group form-group-xs">
                        <label>通用名：</label>
                        <input class="form-control" type="text" id="qualityspecName" placeholder="通用名" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label>药品分类：</label>
                        <input class="form-control" type="text" id="classify" placeholder="药品分类" />
                    </div>
                    
                    
                    <button type="button" class="btn btn-success btn-sm" onclick="search()">查&nbsp;询</button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        <div class=" box box-warning bottongroup">
             <a href="toList.html" class="btn btn-default btn-sm" >返&nbsp;回</a>
        </div>
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
    
    
    //查询
    function search() {
    	var compCode = $("#compCode").val();
        var drugCode = $("#drugCode").val();
        var qualityspecName = $("#qualityspecName").val();
        var classify = $("#classify").val();

        $("#gridlist").jqGrid("clearGridData");
            $("#gridlist").jqGrid('setGridParam',{ 
            url:"${ctx}/bidProject/getBindDrugsDataList.html",
            mtype: "POST",
            datatype:'json',
            postData:{
            		  "compCode":compCode,
            		  "drugCode":drugCode, 
            		  "qualityspecName":qualityspecName, 
            		  "classify":classify},
            page :  1
        }).trigger("reloadGrid"); //重新载入  
    }
        $(function () {
            
            $("#gridlist").jqGrid({
                url: "${ctx}/bidProject/getBindDrugsDataList.html",
                mtype: "POST",
                postData: { "projId" : "${projId}"},
                datatype: "json",
                autowidth: true,
                shrinkToFit:false,
                height: 270,
                colNames: ['projProddrugId','compId','企业编号','企业名称','组织机构代码','所属地区','药品编码','药品名', '剂型', '规格','转换系数','单位','材质','审核状态','澄清状态'],
                colModel: [
                    { name: 'projProddrugId',hidden:true, width: 10, align:"center", sortable: false},
                    { name: 'compId', width: 80, hidden:true , align:"center",sortable: false},
                    { name: 'compCode', width: 100 , align:"center" ,sortable: false},
                    { name: 'compName', width: 140 , align:"center" ,sortable: false},
                    { name: 'orgCode', width: 80 , align:"center" ,sortable: false},
                    { name: 'areaName', width: 80 , align:"center" ,sortable: false},
                    { name: 'drugCode', width : 80, align : 'center', sortable : false},
                    { name: 'qualityspecName', width : 120, align : 'center', sortable : false},
                    { name: 'formName', width : 80, align : 'center', sortable : false},
                    { name: 'specName', width : 80, align : 'center', sortable : false},
                    { name: 'factor', width : 60, align : 'center', sortable : false},
                    { name: 'unit', width : 60, align : 'center', sortable : false},
                    { name: 'materialName', width : 80, align : 'center', sortable : false},
                    { name: 'auditStatus', width : 80, align : 'center', sortable : false},
                    { name: 'complainStatus', width : 80, align : 'center', sortable : false}
                ],
                
                rowNum: 10,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: true, 
                viewrecords: true,
                caption: "${name}-已中标药品 ",
                //序号宽度自动变化
                gridComplete:function(){     
                    var page = $("#gridlist").jqGrid('getGridParam','page');
                    var rows = $('#gridlist').getGridParam("rowNum");
                    var maxnum = (rows*page).toString();
                    var len = (maxnum.length)*10;
                    $('.jqgfirstrow').find('td').eq(0).css('width',len+'px');
                    $('#gridlist_rn').css('width',len+'px');
                },
                jsonReader: {
                    repeatitems: false,
                    id: "drugId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });


       

         
    </script>
</body>
</html>